package com.example.courseapp.fragment;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

import com.bumptech.glide.Glide;
import com.example.courseapp.BitmapUtils;
import com.example.courseapp.R;
import com.example.courseapp.RetrofitHelper;
import com.example.courseapp.SharedPreferencesHelper;
import com.example.courseapp.activity.LoginActivity;
import com.example.courseapp.bean.User;
import com.example.courseapp.net.CourseService;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;


public class MineFragment extends Fragment {


    public MineFragment() {
    }

    TextView userName;

    ImageView imageView;

    Button button;


    public static MineFragment newInstance() {
        return new MineFragment();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_mine, container, false);
        userName = view.findViewById(R.id.userName);
        imageView = view.findViewById(R.id.imageView2);
        button = view.findViewById(R.id.button);
        CourseService courseService = RetrofitHelper.getInstance().createService(CourseService.class);

        button.setOnClickListener(v -> {
            Intent intent = new Intent(requireActivity(), LoginActivity.class);
            startActivity(intent);
        });
        return view;
    }
}